/*
 * Copyright (c) 2006 - 2022, webrx.cn All rights reserved.
 *
 */
package cn.ref;

import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.Parameter;

/**
 * <p>Project: app2022 - R3
 * <p>Powered by webrx On 2022-02-09 14:51:46
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class R3 {
    public static void main(String[] args) {
        var s = String.class;
        //var ms = s.getName();java.lang.String
        Method[] ms = s.getMethods();
        //System.out.println(ms.length);


        for (Method m : ms) {
            var ps = m.getParameters();
            StringBuilder sbu = new StringBuilder();

            for (Parameter p : ps) {
                //System.out.println(p.getName());
                //System.out.println(p.getType().getName());
                sbu.append(p.getType().getName() + " i" + ",");
            }
            if (sbu.length() > 0) {
                sbu.delete(sbu.length() - 1, sbu.length());
            }
            String mstr = String.format("%s %s %s(%s);", Modifier.toString(m.getModifiers()), m.getReturnType().getName(), m.getName(), sbu);
            System.out.println(mstr);
        }

        //Method[] ms2 = s.getDeclaredMethods();
        //System.out.println(ms2.length);
    }
}
